<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>好运网</title>
    <link rel="stylesheet" type="text/css" href="/css/basic.css"/>
    <link rel="stylesheet" type="text/css" href="/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="/css/center.css"/>
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css"/>
</head>
<body>
<div th:include="header::header"></div>

<div class="main">
    <div class="warpk">
        <div class="zx-lf fl">
            <div class="toux">
                <img src="/images/t8.jpg"/><br/>
                会员等级：普通会员
            </div>
            <div class="nr_left_nav"><span class="nr_left_nav_san"> </span>
                <div class="left_nav_one">
                    <div class="left_nav_title"><i></i>资金管理<b></b></div>
                    <dl style="display:block;">
                        <dd th:attr="class=${pagename =='deposit'?'left_nav_ck on':'left_nav_ck'}"><a
                                href="/deposit"><span></span>存款</a></dd>
                        <dd th:attr="class=${pagename =='withdrawal'?'left_nav_tk on':'left_nav_tk'}"><a
                                href="/withdrawal"><span></span>提款</a></dd>
                        <dd th:attr="class=${pagename =='transfer'?'left_nav_zz on':'left_nav_zz'}"><a href="/transfer"><span></span>转账</a>
                        </dd>
                        <dd th:attr="class=${pagename =='records'?'left_nav_jy on':'left_nav_jy'}"><a
                                href="/records"><span></span>交易记录</a></dd>
                        <dd th:attr="class=${pagename =='bankList'?'left_nav_yhk on':'left_nav_yhk'}"><a
                                href="/bankList"><span></span>银行卡</a></dd>
                    </dl>
                </div>
                <div class="left_nav_two">
                    <div class="left_nav_title"><i></i>个人中心<b></b></div>
                    <dl style="display:none;">
                        <dd th:attr="class=${pagename =='accountSetting'?'left_nav_ck on':'left_nav_ck'}">
                            <span></span><a href="/accountSetting">账号设置</a></dd>
                        <dd th:attr="class=${pagename =='systemMessageReceive'?'left_nav_tk on':'left_nav_tk'}">
                            <span></span><a href="/systemMessageReceive"> 消息中心</a></dd>
                        <dd th:attr="class=${pagename =='bettingRecord'?'left_nav_jy on':'left_nav_jy'}"><span></span><a
                                href="/bettingRecord/timeRange/1">投注记录</a></dd>
                    </dl>
                </div>
            </div>
            <link rel="stylesheet" href="/js/loading/loading.css">
            <script src="/js/loading/loading.js"></script>
            <script>
                var jiuXiuLoad = new Loading();
                jiuXiuLoad.init();

                $(function () {
                    function addClasson(id) {
                        $(id).find('.left_nav_title').click(function () {
                            var $left_nav_one = $(id);
                            $(this).toggleClass("on");
                            if (!$(this).hasClass("on")) {
                                $left_nav_one.find('dl').slideUp()
                            } else {
                                $left_nav_one.find('dl').slideDown()
                            }
                        })
                    }

                    addClasson('.left_nav_one');
                    addClasson('.left_nav_two');
                    $(".nr_left_nav").find("dl").find(".on").parent().prev().toggleClass("on");
                    $(".nr_left_nav").find("dl").find(".on").parent().show();


                    /**
                     * 刷新操作   占时写的定时器
                     * 自己改为ajax 加载
                     * @param {Object} text
                     */
                    $("#refreshMainBt").click(function () {
                        $("#MainBalance_b").html('<img style="height:20px;margin-left:40px;" src="/images/load.gif" />');

                        jiuXiuLoad.start();
                        $.ajax({
                            method: "POST",
                            url: "/api/refreshUserInfo",
                            dataType: "json"
                        }).done(function (msg) {
                            jiuXiuLoad.stop();
                            if (msg.status == 'success') {
                                $("#MainBalance_b").html('<i>¥  </i><h>' + formatCurrency2(msg.data.userBalance) + '</h>');
                                $("#hg_balace").html(formatCurrency2(msg.data.hgBalance));
                                clearInterval(mtime);
                            } else {
                                $("#MainBalance_b").html('<i>¥  </i> <h>0.00</h>');
                                clearInterval(mtime);
                            }
                        });

                        t = 3;
                        var mtime = setInterval(function () {
                            t--;
                            if (t == 0) {
                                clearInterval(mtime);
                                $("#MainBalance_b").html('<i>¥</i> <h>0.00</h>');
                            }
                        }, 1000);
                    });


                    function formatCurrency2(num) {
                        if (!num || isNaN(num)) {
                            num = "0.00";
                        }
                        num = num.toString().replace(/\$|\,/g, '');
                        sign = (num == (num = Math.abs(num)));
                        num = Math.floor(num * 100 + 0.50000000001);
                        cents = num % 100;
                        num = Math.floor(num / 100).toString();
                        if (cents < 10)
                            cents = "0" + cents;
                        for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
                            num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
                        }
                        return (((sign) ? '' : '-') + num + '.' + cents);
                    }

                })
            </script>
            <a href="/logout">
                <div class="tuichu"><img src="/images/ico25.png"/>退出</div>
            </a>
        </div>

        <div class="zx-rt-s fl">
            <div class="zxs-01">
                <div class="nr_nav_user m40l m30t">
                    <div class="nr_nav_user_title"><span id="salutationtext">您好，</span>
                        <b>
                            <h th:text="${session.loginSession.userName}"/>
                        </b>
                    </div>
                    <div class="nr_nav_user_time">上次登录时间：
                        <h th:text="${session.loginSession.updateTimeStr}"/>
                    </div>
                    <div class="progress-box">
                        <div class="progress">
                            <div class="progress-bar" role="progressbar" data-transitiongoal-backup="0"
                                 data-transitiongoal="0" aria-valuenow="0"
                                 th:style="'width:' + (${session.loginSession.securityLevel == 3} ? '100%' : (${session.loginSession.securityLevel == 2} ? '66.6%' : (${session.loginSession.securityLevel == 1} ? '33.3%' : '20%'))) + ''"></div>
                        </div>
                    </div>
                    <div class="nr_nav_user_help">
                        <span>账户安全等级
                            <strong th:if="${session.loginSession.securityLevel ==1}">弱</strong>
                            <strong th:if="${session.loginSession.securityLevel ==2}">中等</strong>
                            <strong th:if="${session.loginSession.securityLevel ==3}">强</strong>
                        </span>
                        <span>
                            <b th:attr="class=${session.loginSession.phoneStatus == 2}?'pic_1 xuanz1':'pic_1 level'">
                                <i>提示：为了享受更便捷的手机app服务，<br/>
                                    请先<a href="/accountSetting?t=1#phone"> 绑定手机！</a>
                                </i>
                            </b>
                            <b th:attr="class=${session.loginSession.emailStatus == 2}?'pic_2 xuanz2':'pic_2 level'">
                                <i>提示：为了享受更便捷的找回密码服务，<br/>
                                    请先<a href="/accountSetting?t=2#mail"> 绑定邮箱！</a>
                                </i>
                            </b>
                            <b th:attr="class=${session.loginSession.realName != ''}?'pic_3 xuanz3':'pic_3 level'">
                                <i>提示：为了享受更便捷的提款服务，<br/>
                                    请先<a href="/accountSetting"> 绑定真实姓名！</a>
                                </i>
                            </b>
                            <b th:attr="class=${session.loginSession.bankStatus == 2}?'pic_4 xuanz4':'pic_4 level'">
                                <i>提示：为了享受更便捷的提款服务，<br/>
                                    请先<a href="/bankList"> 绑定银行卡！</a>
                                </i>
                            </b>
                        </span>
                    </div>
                </div>

                <div class="nr_nav_money">
                    <div class="nr_nav_money_title"><span>账户余额</span>(中心钱包)</div>
                    <div class="nr_nav_money_num">
                        <b id="MainBalance_b" class="m15b" style="display:inline-block">
                            <i>¥</i>
                            <h th:text="${#numbers.formatDecimal(session.loginSession.userBalance, 0, 'COMMA', 2, 'POINT')}">
                                0.00
                            </h>
                        </b>
                        <div id="refreshMainBt" style="cursor: pointer;"><span></span><i class="tkl fs14">刷新</i></div>
                    </div>
                </div>
            </div>

            <div class="nr_history_right">
                <div class="tk_all_moeny">
                    <ul>
                        <li><span>体育</span>
                            <p id="hold_balace">0.00</p>
                        </li>
                        <li><span>如意厅(AG)</span>
                            <p id="sportsbook_balace">0.00</p>
                        </li>
                        <li><span>锦绣厅(HG)</span>
                            <p id="hg_balace"
                               th:text="${#numbers.formatDecimal(session.loginSession.hgBalance, 0, 'COMMA', 2, 'POINT')}"></p>
                        </li>
                        <li><span>吉祥厅(BB)</span>
                            <p id="grandsuite_balace">0.00</p>
                        </li>
                        <li><span>福瑞厅(AI)</span>
                            <p id="keno_balace">0.00</p>
                        </li>
                        <li><span>快乐彩(LB)</span>
                            <p id="keno_balace">0.00</p>
                        </li>
                        <li style="border-right:1px #000 solid;"><span>PT游戏厅</span>
                            <p id="ptslot_balace">0.00</p>
                        </li>
                    </ul>
                </div>

                <div th:include="${pagename}::${pagename}"></div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</div>
<div th:include="footer::footer"></div>

<div th:include="right::right"></div>
</body>
</html>
